import sympy as sp

x, y = sp.symbols('x y')
y_func = sp.Function('y')
eq = sp.Eq(y_func(x).diff(x), 2*x*(1 + y_func(x)**2))
solution = sp.dsolve(eq)
print(solution)